<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Runner::Options</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Runner::Options</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/runner/options_rb.html">
                vendor/plugins/rspec/lib/spec/runner/options.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000193">configure</a>&nbsp;&nbsp;
      <a href="#M000197">configure_differ</a>&nbsp;&nbsp;
      <a href="#M000195">configure_formatters</a>&nbsp;&nbsp;
      <a href="#M000194">create_behaviour_runner</a>&nbsp;&nbsp;
      <a href="#M000196">create_reporter</a>&nbsp;&nbsp;
      <a href="#M000205">load_class</a>&nbsp;&nbsp;
      <a href="#M000192">new</a>&nbsp;&nbsp;
      <a href="#M000198">parse_diff</a>&nbsp;&nbsp;
      <a href="#M000199">parse_example</a>&nbsp;&nbsp;
      <a href="#M000200">parse_format</a>&nbsp;&nbsp;
      <a href="#M000203">parse_generate_options</a>&nbsp;&nbsp;
      <a href="#M000202">parse_heckle</a>&nbsp;&nbsp;
      <a href="#M000201">parse_require</a>&nbsp;&nbsp;
      <a href="#M000204">split_at_colon</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">BUILT_IN_FORMATTERS</td>
          <td>=</td>
          <td class="context-item-value">{         'specdoc'  =&gt; Formatter::SpecdocFormatter,         's'        =&gt; Formatter::SpecdocFormatter,         'html'     =&gt; Formatter::HtmlFormatter,         'h'        =&gt; Formatter::HtmlFormatter,         'rdoc'     =&gt; Formatter::RdocFormatter,         'r'        =&gt; Formatter::RdocFormatter,         'progress' =&gt; Formatter::ProgressBarFormatter,         'p'        =&gt; Formatter::ProgressBarFormatter,         'failing_examples' =&gt; Formatter::FailingExamplesFormatter,         'e'        =&gt; Formatter::FailingExamplesFormatter,         'failing_behaviours' =&gt; Formatter::FailingBehavioursFormatter,         'b'        =&gt; Formatter::FailingBehavioursFormatter</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">backtrace_tweaker</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">behaviour_runner</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">colour</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">context_lines</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">diff_format</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">differ_class</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">dry_run</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">examples</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">failure_file</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">formatters</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">generate</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">heckle_runner</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">line_number</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">loadby</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">reporter</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">reverse</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">runner_arg</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">timeout</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">verbose</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000192" class="method-detail">
        <a name="M000192"></a>

        <div class="method-heading">
          <a href="#M000192" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(err, out)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000192-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000192-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 41</span>
41:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">err</span>, <span class="ruby-identifier">out</span>)
42:         <span class="ruby-ivar">@err</span>, <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">err</span>, <span class="ruby-identifier">out</span>
43:         <span class="ruby-ivar">@backtrace_tweaker</span> = <span class="ruby-constant">QuietBacktraceTweaker</span>.<span class="ruby-identifier">new</span>
44:         <span class="ruby-ivar">@examples</span> = []
45:         <span class="ruby-ivar">@formatters</span> = []
46:         <span class="ruby-ivar">@colour</span> = <span class="ruby-keyword kw">false</span>
47:         <span class="ruby-ivar">@dry_run</span> = <span class="ruby-keyword kw">false</span>
48:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000193" class="method-detail">
        <a name="M000193"></a>

        <div class="method-heading">
          <a href="#M000193" class="method-signature">
          <span class="method-name">configure</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000193-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000193-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 50</span>
50:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>
51:         <span class="ruby-identifier">configure_formatters</span>
52:         <span class="ruby-identifier">create_reporter</span>
53:         <span class="ruby-identifier">configure_differ</span>
54:         <span class="ruby-identifier">create_behaviour_runner</span>
55:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000197" class="method-detail">
        <a name="M000197"></a>

        <div class="method-heading">
          <a href="#M000197" class="method-signature">
          <span class="method-name">configure_differ</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000197-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 79</span>
79:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_differ</span>
80:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@differ_class</span>
81:           <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Expectations</span>.<span class="ruby-identifier">differ</span> = <span class="ruby-ivar">@differ_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@diff_format</span>, <span class="ruby-ivar">@context_lines</span>, <span class="ruby-ivar">@colour</span>)
82:         <span class="ruby-keyword kw">end</span>
83:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000195" class="method-detail">
        <a name="M000195"></a>

        <div class="method-heading">
          <a href="#M000195" class="method-signature">
          <span class="method-name">configure_formatters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000195-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 68</span>
68:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_formatters</span>
69:         <span class="ruby-ivar">@formatters</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">formatter</span><span class="ruby-operator">|</span>
70:           <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">colour</span> = <span class="ruby-ivar">@colour</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:colour=</span>)
71:           <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">dry_run</span> = <span class="ruby-ivar">@dry_run</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:dry_run=</span>)
72:         <span class="ruby-keyword kw">end</span>
73:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000194" class="method-detail">
        <a name="M000194"></a>

        <div class="method-heading">
          <a href="#M000194" class="method-signature">
          <span class="method-name">create_behaviour_runner</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000194-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 57</span>
57:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_behaviour_runner</span>
58:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@generate</span>
59:         <span class="ruby-ivar">@behaviour_runner</span> = <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@runner_arg</span>
60:           <span class="ruby-identifier">klass_name</span>, <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">split_at_colon</span>(<span class="ruby-ivar">@runner_arg</span>)
61:           <span class="ruby-identifier">runner_type</span> = <span class="ruby-identifier">load_class</span>(<span class="ruby-identifier">klass_name</span>, <span class="ruby-value str">'behaviour runner'</span>, <span class="ruby-value str">'--runner'</span>)
62:           <span class="ruby-identifier">runner_type</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">arg</span>)
63:         <span class="ruby-keyword kw">else</span>
64:           <span class="ruby-constant">BehaviourRunner</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
65:         <span class="ruby-keyword kw">end</span>
66:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000196" class="method-detail">
        <a name="M000196"></a>

        <div class="method-heading">
          <a href="#M000196" class="method-signature">
          <span class="method-name">create_reporter</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000196-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 75</span>
75:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_reporter</span>
76:         <span class="ruby-ivar">@reporter</span> = <span class="ruby-constant">Reporter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@formatters</span>, <span class="ruby-ivar">@backtrace_tweaker</span>)
77:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000205" class="method-detail">
        <a name="M000205"></a>

        <div class="method-heading">
          <a href="#M000205" class="method-signature">
          <span class="method-name">load_class</span><span class="method-args">(name, kind, option)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000205-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000205-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 156</span>
156:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_class</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">option</span>)
157:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/</span>
158:           <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">$2</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">$2</span>
159:           [<span class="ruby-identifier">$1</span>, <span class="ruby-identifier">arg</span>]
160:         <span class="ruby-keyword kw">else</span>
161:           <span class="ruby-identifier">m</span> = <span class="ruby-node">&quot;#{name.inspect} is not a valid class name&quot;</span>
162:           <span class="ruby-ivar">@err</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">m</span>
163:           <span class="ruby-identifier">raise</span> <span class="ruby-identifier">m</span>
164:         <span class="ruby-keyword kw">end</span>
165:         <span class="ruby-keyword kw">begin</span>
166:           <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">binding</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
167:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
168:           <span class="ruby-ivar">@err</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Couldn't find #{kind} class #{name}&quot;</span>
169:           <span class="ruby-ivar">@err</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Make sure the --require option is specified *before* #{option}&quot;</span>
170:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$_</span><span class="ruby-identifier">spec_spec</span> ; <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span> ; <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">exit</span>(<span class="ruby-value">1</span>) ; <span class="ruby-keyword kw">end</span>
171:         <span class="ruby-keyword kw">end</span>
172:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000198" class="method-detail">
        <a name="M000198"></a>

        <div class="method-heading">
          <a href="#M000198" class="method-signature">
          <span class="method-name">parse_diff</span><span class="method-args">(format)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000198-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000198-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 85</span>
 85:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_diff</span>(<span class="ruby-identifier">format</span>)
 86:         <span class="ruby-ivar">@context_lines</span> = <span class="ruby-value">3</span>
 87:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">format</span>
 88:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:context</span>, <span class="ruby-value str">'context'</span>, <span class="ruby-value str">'c'</span>
 89:             <span class="ruby-ivar">@diff_format</span>  = <span class="ruby-identifier">:context</span>
 90:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:unified</span>, <span class="ruby-value str">'unified'</span>, <span class="ruby-value str">'u'</span>, <span class="ruby-value str">''</span>, <span class="ruby-keyword kw">nil</span>
 91:             <span class="ruby-ivar">@diff_format</span>  = <span class="ruby-identifier">:unified</span>
 92:         <span class="ruby-keyword kw">end</span>
 93: 
 94:         <span class="ruby-keyword kw">if</span> [<span class="ruby-identifier">:context</span>,<span class="ruby-identifier">:unified</span>].<span class="ruby-identifier">include?</span> <span class="ruby-ivar">@diff_format</span>
 95:           <span class="ruby-identifier">require</span> <span class="ruby-value str">'spec/expectations/differs/default'</span>
 96:           <span class="ruby-ivar">@differ_class</span> = <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Expectations</span><span class="ruby-operator">::</span><span class="ruby-constant">Differs</span><span class="ruby-operator">::</span><span class="ruby-constant">Default</span>
 97:         <span class="ruby-keyword kw">else</span>
 98:           <span class="ruby-ivar">@diff_format</span>  = <span class="ruby-identifier">:custom</span>
 99:           <span class="ruby-ivar">@differ_class</span> = <span class="ruby-identifier">load_class</span>(<span class="ruby-identifier">format</span>, <span class="ruby-value str">'differ'</span>, <span class="ruby-value str">'--diff'</span>)
100:         <span class="ruby-keyword kw">end</span>
101:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000199" class="method-detail">
        <a name="M000199"></a>

        <div class="method-heading">
          <a href="#M000199" class="method-signature">
          <span class="method-name">parse_example</span><span class="method-args">(example)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000199-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000199-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 103</span>
103:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_example</span>(<span class="ruby-identifier">example</span>)
104:         <span class="ruby-keyword kw">if</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">example</span>))
105:           <span class="ruby-ivar">@examples</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">example</span>).<span class="ruby-identifier">read</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
106:         <span class="ruby-keyword kw">else</span>
107:           <span class="ruby-ivar">@examples</span> = [<span class="ruby-identifier">example</span>]
108:         <span class="ruby-keyword kw">end</span>
109:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000200" class="method-detail">
        <a name="M000200"></a>

        <div class="method-heading">
          <a href="#M000200" class="method-signature">
          <span class="method-name">parse_format</span><span class="method-args">(format_arg)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000200-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000200-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 111</span>
111:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_format</span>(<span class="ruby-identifier">format_arg</span>)
112:         <span class="ruby-identifier">format</span>, <span class="ruby-identifier">where</span> = <span class="ruby-identifier">split_at_colon</span>(<span class="ruby-identifier">format_arg</span>)
113:         <span class="ruby-comment cmt"># This funky regexp checks whether we have a FILE_NAME or not</span>
114:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">where</span>.<span class="ruby-identifier">nil?</span>
115:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;When using several --format options only one of them can be without a file&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@out_used</span>
116:           <span class="ruby-identifier">where</span> = <span class="ruby-ivar">@out</span>
117:           <span class="ruby-ivar">@out_used</span> = <span class="ruby-keyword kw">true</span>
118:         <span class="ruby-keyword kw">end</span>
119: 
120:         <span class="ruby-identifier">formatter_type</span> = <span class="ruby-constant">BUILT_IN_FORMATTERS</span>[<span class="ruby-identifier">format</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">load_class</span>(<span class="ruby-identifier">format</span>, <span class="ruby-value str">'formatter'</span>, <span class="ruby-value str">'--format'</span>)
121:         <span class="ruby-ivar">@formatters</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">formatter_type</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">where</span>)
122:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000203" class="method-detail">
        <a name="M000203"></a>

        <div class="method-heading">
          <a href="#M000203" class="method-signature">
          <span class="method-name">parse_generate_options</span><span class="method-args">(options_file, args_copy, out_stream)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000203-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000203-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 134</span>
134:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_generate_options</span>(<span class="ruby-identifier">options_file</span>, <span class="ruby-identifier">args_copy</span>, <span class="ruby-identifier">out_stream</span>)
135:         <span class="ruby-comment cmt"># Remove the --generate-options option and the argument before writing to file</span>
136:         <span class="ruby-identifier">index</span> = <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">&quot;-G&quot;</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">&quot;--generate-options&quot;</span>)
137:         <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">index</span>)
138:         <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">index</span>)
139:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">options_file</span>, <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
140:           <span class="ruby-identifier">io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
141:         <span class="ruby-keyword kw">end</span>
142:         <span class="ruby-identifier">out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nOptions written to #{options_file}. You can now use these options with:&quot;</span>
143:         <span class="ruby-identifier">out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;spec --options #{options_file}&quot;</span>
144:         <span class="ruby-ivar">@generate</span> = <span class="ruby-keyword kw">true</span>
145:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000202" class="method-detail">
        <a name="M000202"></a>

        <div class="method-heading">
          <a href="#M000202" class="method-signature">
          <span class="method-name">parse_heckle</span><span class="method-args">(heckle)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000202-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000202-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 128</span>
128:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_heckle</span>(<span class="ruby-identifier">heckle</span>)
129:         <span class="ruby-identifier">heckle_require</span> = [<span class="ruby-regexp re">/mswin/</span>, <span class="ruby-regexp re">/java/</span>].<span class="ruby-identifier">detect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">RUBY_PLATFORM</span>} <span class="ruby-operator">?</span> <span class="ruby-value str">'spec/runner/heckle_runner_unsupported'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'spec/runner/heckle_runner'</span>
130:         <span class="ruby-identifier">require</span> <span class="ruby-identifier">heckle_require</span>
131:         <span class="ruby-ivar">@heckle_runner</span> = <span class="ruby-constant">HeckleRunner</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">heckle</span>)
132:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000201" class="method-detail">
        <a name="M000201"></a>

        <div class="method-heading">
          <a href="#M000201" class="method-signature">
          <span class="method-name">parse_require</span><span class="method-args">(req)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000201-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000201-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 124</span>
124:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_require</span>(<span class="ruby-identifier">req</span>)
125:         <span class="ruby-identifier">req</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;,&quot;</span>).<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">require</span> <span class="ruby-identifier">file</span>}
126:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000204" class="method-detail">
        <a name="M000204"></a>

        <div class="method-heading">
          <a href="#M000204" class="method-signature">
          <span class="method-name">split_at_colon</span><span class="method-args">(s)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000204-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000204-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/options.rb, line 147</span>
147:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split_at_colon</span>(<span class="ruby-identifier">s</span>)
148:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/([a-zA-Z_]+(?:::[a-zA-Z_]+)*):?(.*)/</span>
149:           <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">$2</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">$2</span>
150:           [<span class="ruby-identifier">$1</span>, <span class="ruby-identifier">arg</span>]
151:         <span class="ruby-keyword kw">else</span>
152:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Couldn't parse #{s.inspect}&quot;</span>
153:         <span class="ruby-keyword kw">end</span>
154:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>